package code.c02_list.homework;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/9/15 19:14
 * @package code.c02_list.homework
 * @description 文件说明
 */

import java.util.Arrays;
import java.util.Scanner;

public class Example {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while (sc.hasNext()) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int arc[] = new int[n + 1];
            if (n == 0 && m == 0) {
                System.exit(0);
            }
            arc[n] = m;
            for (int i = 0; i < n; i++) {
                arc[i] = sc.nextInt();
            }
            Arrays.sort(arc);

            for (int i = 0; i < n + 1; i++) {
                if (i == 0) {
                    System.out.print(arc[i]);
                } else
                    System.out.print(" " + arc[i]);
            }
            System.out.println();
        }
    }
}